package com.infolab.aims.domain.workorder;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.infolab.aims.common.bean.AbstractModelBean;
import com.infolab.aims.domain.SystemCodeValue;
import com.infolab.aims.domain.asset.AssetModel;

@Entity
@Table(name="AMTB_WORKORDER_DETAIL")
public class WorkOrderDetail extends AbstractModelBean  {
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer workOrderDetailId;
	
	@ManyToOne
	@JoinColumn(name="workOrderId")
	private WorkOrder workOrder;
	
	private String workOrderDetailType;
	
	private String workOrderDetailRemarks;
	
	@ManyToOne
	@JoinColumn(name="genericCode",referencedColumnName="systemCode1")
	private SystemCodeValue genericCode;

	@ManyToOne
	@JoinColumn(name="assetModelId")
	private AssetModel assetModel;
	
	@Transient
	private boolean deleted;

	public Integer getWorkOrderDetailId() {
		return workOrderDetailId;
	}

	public void setWorkOrderDetailId(Integer workOrderDetailId) {
		this.workOrderDetailId = workOrderDetailId;
	}

	public WorkOrder getWorkOrder() {
		return workOrder;
	}

	public void setWorkOrder(WorkOrder workOrder) {
		this.workOrder = workOrder;
	}

	public String getWorkOrderDetailType() {
		return workOrderDetailType;
	}

	public void setWorkOrderDetailType(String workOrderDetailType) {
		this.workOrderDetailType = workOrderDetailType;
	}

	public String getWorkOrderDetailRemarks() {
		return workOrderDetailRemarks;
	}

	public void setWorkOrderDetailRemarks(String workOrderDetailRemarks) {
		this.workOrderDetailRemarks = workOrderDetailRemarks;
	}

	

	public SystemCodeValue getGenericCode() {
		return genericCode;
	}

	public void setGenericCode(SystemCodeValue genericCode) {
		this.genericCode = genericCode;
	}

	public AssetModel getAssetModel() {
		return assetModel;
	}

	public void setAssetModel(AssetModel assetModel) {
		this.assetModel = assetModel;
	}
	
	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}


	public static final String WORKORDERDETAILTYPE_COMPLAINT="CMPLN";
	public static final String WORKORDERDETAILTYPE_REPAIR="RPAIR";
}
